Skip to content

Conversation

@hexbabe
Copy link
Member

@hexbabe hexbabe commented Aug 25, 2025

This PR is part of the SDK changes of the Consolidate GetImage(s) project

It

  • Updates the GetImages signature to be in line with the new camera.proto
  • Updates unit tests accordingly

Manual Testing

Built a local RealSense module executable with its C++ SDK pinned to this commit d8292df

Added logging to make sure that the server is receiving extra and filter_source_names. It was

8/27/2025, 2:16:11 PM info Viam C++ SDK     [src/camera_realsense.cpp:439] extra keys: ["foo"]   log_ts 2025-08-27T14:16:11.789Z

8/27/2025, 2:16:11 PM info Viam C++ SDK     [src/camera_realsense.cpp:426] filter_source_names: ["color"]   log_ts 2025-08-27T14:16:11.788Z

Verified client received back metadata and loaded the image properly.

2025-08-27 14:16:11,704         INFO    viam.rpc.dial (dial.py:336)     Connecting to socket: /tmp/proxy-6MDrUDgt.sock
captured_at {
  seconds: 1756318571
  nanos: 669000000
}

length of images: 1
image/jpeg

@hexbabe hexbabe requested a review from a team as a code owner August 25, 2025 17:27
@hexbabe hexbabe requested review from dhritinaidu and njooma and removed request for a team August 25, 2025 17:27
@hexbabe hexbabe force-pushed the RSDK-11703-and-11602 branch 2 times, most recently from 8b56b94 to 955d8b0 Compare August 25, 2025 18:39
@hexbabe hexbabe changed the title [RSDK-11703, RSDK-11602] Update GetImages signature [RSDK-11703, RSDK-11602] Update C++ GetImages signature Aug 25, 2025
@hexbabe hexbabe requested a review from lia-viam August 25, 2025 18:59
@hexbabe hexbabe marked this pull request as draft August 25, 2025 18:59
@hexbabe hexbabe marked this pull request as ready for review August 25, 2025 20:31
@hexbabe hexbabe marked this pull request as draft August 26, 2025 02:32
@hexbabe hexbabe marked this pull request as ready for review August 27, 2025 18:18
@hexbabe
Copy link
Member Author

hexbabe commented Aug 27, 2025

@lia-viam @njooma @dhritinaidu manual testing is now done. Please review

.with(extra,
[&](auto& request) {
for (const auto& source_name : filter_source_names) {
*request.add_filter_source_names() = source_name;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does request have a mutable_filter_source_names() member or similar? if so we could do *request.mutable_filter_source_names() = filter_source_names() rather than copying elementwise

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry so what I meant here was that we could maybe replace the entirety for the for loop with just *request.mutable_filter_source_names() = std::move(filter_source_names)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad. Tried to address

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoot looks like it's failing in CI because of the old grpc version. you can just revert to what you had before, i forgot about stupid RepeatedPtrField

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah gotcha, by "what you had before" do you mean the element-wise copying, or the for loop with the mutable_filter_source_names?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you were doing element-wise copying in both of them so whichever makes the build pass is fine! for reference here's how we do it for vectors of proto types
https://github.com/viamrobotics/viam-cpp-sdk/blob/main/src/viam/sdk/common/private/repeated_ptr_convert.hpp#L16

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. Does the comment I added make sense?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah not quite, you can omit the comment or just write

// in newer gRPC versions we would be able to call `Add` or `Assign` on an iterator range rather than element-wise copy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha done thank you!

@hexbabe hexbabe force-pushed the RSDK-11703-and-11602 branch from b1952dd to 5a5f9bf Compare August 29, 2025 14:52
@hexbabe hexbabe force-pushed the RSDK-11703-and-11602 branch from 5a5f9bf to a23a644 Compare August 29, 2025 14:57
@hexbabe hexbabe requested a review from lia-viam August 29, 2025 14:57
@hexbabe hexbabe force-pushed the RSDK-11703-and-11602 branch from a23a644 to d16c6c7 Compare August 29, 2025 15:47
@hexbabe
Copy link
Member Author

hexbabe commented Aug 29, 2025

thanks for review!

@hexbabe hexbabe merged commit 5b8ef22 into viamrobotics:main Aug 29, 2025
5 checks passed
@hexbabe hexbabe deleted the RSDK-11703-and-11602 branch August 29, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants